<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
<meta name="description"
	content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

<link rel="shortcut icon"
	href="<%=request.getContextPath()%>/Hplus/favicon.ico">
<link
	href="<%=request.getContextPath()%>/Hplus/css/bootstrap.min.css?v=3.3.6"
	rel="stylesheet">
<link
	href="<%=request.getContextPath()%>/Hplus/css/font-awesome.css?v=4.4.0"
	rel="stylesheet">

<!-- jqgrid-->
<link
	href="<%=request.getContextPath()%>/Hplus/css/plugins/jqgrid/ui.jqgrid.css?0820"
	rel="stylesheet">

<link href="<%=request.getContextPath()%>/Hplus/css/animate.css"
	rel="stylesheet">
<link href="<%=request.getContextPath()%>/Hplus/css/style.css?v=4.1.0"
	rel="stylesheet">

<style>
/* Additional style to fix warning dialog position */
#alertmod_table_list_2 {
	top: 900px !important;
}

.close {
	position: relative;
	margin-top: -40%;
	margin-right: -20%;
}

.tabSpan {
	background-color: #F4A460;
	font-size: 25px;
	cursor: pointer;
}

.tabSpan {
	font-size: 20px;
	cursor: pointer;
}
</style>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<form method="get" class="form-horizontal">
					
					<div class="ibox float-e-margins">
						<div class="ibox-title"></div>
						<div class="ibox-content">


							<div class="form-group">
								<label class="col-sm-4 control-label">标识：</label>
								<div class="col-sm-5">
									<input type="text" name="curd_form_id" class="form-control"
										placeholder="请输入标识">
								</div>
							</div>



							<div class="form-group">
								<label class="col-sm-4 control-label">排序字段：</label>
								<div class="col-sm-5">
									<input type="text" name="order_by" class="form-control"
										placeholder="请输入排序字段">
								</div>
							</div>

							
							<div class="form-group">
								<label class="col-sm-4 control-label">模块路径：</label>
								<div class="col-sm-5">
									<input type="text" name="module_path" class="form-control"
										placeholder="请输入模块路径">
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-4 control-label">sql：</label>
								<div class="col-sm-5">
									<textarea id="sql_content" name="sql_content" class="form-control" placeholder="请输入sql语句"
										cols="10" rows="5"></textarea>
								</div>
							</div>



						</div>
						<div class="hr-line-dashed"></div>
						<div class="ibox-content">
							<table class="table">
								<tr>
									<td><span class="tabSpan" onclick="addTabCol();">新增列
									</span></td>

<!-- 									<TD><SPAN CLASS="TABSPAN">删除列</SPAN></TD> -->

									<td><span class="tabSpan" onclick="addButton();">新增按钮</span>
									</td>

									<td><span class="tabSpan" onclick="addJs();">配置js</span></td>
								</tr>
							</table>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="ibox-content">

							<div class="form-group btnDiv">
								<!-- 						        <label class="col-sm-1 control-label"></label> -->
								<div class="col-sm-1">
									<button type="button" class="btn btn-w-m btn-info btnHandler"
										ondblclick="getBtnInfo(this)">新增</button>
									<span class="close" onclick="closeBtn(this);"> <img
										alt="关闭" src="<%=request.getContextPath()%>/img/close.png"
										width="15" height="15">
									</span> <input type="hidden" id="add" name="btnAdd"
										value="add,新增,add();" />
								</div>

								<!-- 						        <label class="col-sm-1 control-label"></label> -->
								<div class="col-sm-1">

									<button type="button" class="btn btn-w-m btn-info btnHandler"
										ondblclick="getBtnInfo(this)">修改</button>
									<span class="close" onclick="closeBtn(this);"> <img
										alt="关闭" src="<%=request.getContextPath()%>/img/close.png"
										width="15" height="15">
									</span> <input type="hidden" id="update" name="btnUpdate"
										value="update,修改,update();" />
								</div>

								<!-- 						        <label class="col-sm-1 control-label"></label> -->
								<div class="col-sm-1">
									<button type="button" class="btn btn-w-m btn-info btnHandler"
										ondblclick="getBtnInfo(this)">删除</button>
									<span class="close" onclick="closeBtn(this);"> <img
										alt="关闭" src="<%=request.getContextPath()%>/img/close.png"
										width="15" height="15">
									</span> <input type="hidden" id="delete" name="btnDelete"
										value="delete,删除,delete();" />
								</div>
							</div>

							<table id="listTab" class="table table-bordered">
								<thead>
									<tr class="tabTr">
										<th><span class="tabSpan" onclick="tabClick(this);">列名</span>
											<input type="hidden" id="tabSapn1" name="tabSpan1" /></th>
										<th><span class="tabSpan" onclick="tabClick(this);">列名</span>
											<input type="hidden" id="tabSapn2" name="tabSpan2" /></th>
										<th><span class="tabSpan" onclick="tabClick(this);">列名</span>
											<input type="hidden" id="tabSapn3" name="tabSpan3" /></th>
									</tr>
								</thead>
							</table>
						</div>

						<div class="hr-line-dashed"></div>
						<div class="ibox-content">

							<div class="form-group btnDiv">
								<div class="col-sm-1">
									<button type="button" class="btn btn-w-m btn-info btnHandler"
										onclick="addSearch();">新增查询</button>
								</div>
							</div>
							<table id="searchTab" class="table table-bordered">
								<thead>
									<tr class="tabSearchTr">

									</tr>
								</thead>
							</table>

						</div>
						
<!-- 						<div class="hr-line-dashed"></div> -->
<!-- 						<div class="ibox-content"> -->
<!-- 							<div class="col-sm-1"> -->
<!-- 									<button class="btn btn-w-m btn-info btnHandler" onclick="save();">保存</button> -->
<!-- 								</div> -->
<!-- 						</div> -->

					</div>
					<input type="hidden" id="curdJs" name="js" />
				</form>
			</div>
		</div>
	</div>



	<!-- 全局js -->
	<script
		src="<%=request.getContextPath()%>/Hplus/js/jquery.min.js?v=2.1.4"></script>
	<script
		src="<%=request.getContextPath()%>/Hplus/js/bootstrap.min.js?v=3.3.6"></script>

	<!-- 自定义js -->
	<script
		src="<%=request.getContextPath()%>/Hplus/js/content.js?v=1.0.0"></script>

	<!-- iCheck -->
	<script
		src="<%=request.getContextPath()%>/Hplus/js/plugins/iCheck/icheck.min.js"></script>

	<script type="text/javascript"
		src="<%=request.getContextPath()%>/js/baseUI.js"></script>
	<script type="text/javascript"
		src="<%=request.getContextPath()%>/js/layer.js"></script>
	<script>
        function closeBtn(obj){
        	$(obj).parent().remove();
        	
        }

		function getBtnInfo(obj){
			var val = $(obj).parent().find("input").val();
			iframePop("按钮信息","<%=request.getContextPath()%>/curdPop/toPop?val="+val,"380px","50%");
		}
        
        function addButton(){
        	iframePop("按钮","<%=request.getContextPath()%>/curdPop/toPop","380px","50%");
        }
        
        function tabClick(obj){
        	var sql = $("#sql_content").val();
        	
      		var val = $(obj).parent().find("input").val();
      		
        	var id = $(obj).parent().find("input").attr("id");
        	if(val == ""){
        		iframePop("列设置","<%=request.getContextPath()%>/curdList/getTabColInfo?tabSpanId="+id+"&sql="+sql,"380px","50%");
        	}else{
        		iframePop("列设置修改","<%=request.getContextPath()%>/curdList/getTabColInfo?val="+val+"&tabSpanId="+id+"&sql="+sql,"380px","50%");
        	}
        	
        	
        }
        
        function addTabCol(){
        	var len = $("#listTab").find("tr").find("th").length;
        	var html = "<th>";
        	html += "<span class=\"tabSpan\" onclick=\"tabClick(this);\">列名</span>";
        	html += "<input type=\"hidden\" id=\"tabSapn"+len+1+"\" name=\"tabSpan"+len+1+"\"/>";
        	html += "</th>";
        	
        	$(".tabTr").append(html);
        }
        
        function addSearch(){
        	iframePop("搜索设置","<%=request.getContextPath()%>/curdPop/toSearchPop",
					"380px", "50%");
		}
        
        function addJs(){
        	iframePop("js设置","<%=request.getContextPath()%>/curdPop/toJsPop",
					"80%", "80%");
        }
        
        function save(){
        	$.ajax({
        		type: 'post',
        	    url: '<%=request.getContextPath() %>/commonQuery/insertCommonQueryInfo',
        	    data: $("form").serialize(),
        	    success: function(data) {
        	        var d = data;
        	        alert(data);
        	    }
        	});
        }
	</script>

	<script type="text/javascript"
		src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
	<!--统计代码，可删除-->

</body>
</html>